export function showPorts(node, show) {
  const container = document.querySelector('.x6-graph')
  const ports = container.querySelectorAll('.x6-port-body')
  for (let i = 0, len = ports.length; i < len; i += 1) {
    ports[i].style.visibility = show ? 'visible' : 'hidden'
  }
}

export function createPods(...arr) {
  const result = {
    items: [],
    groups: {},
  }
  arr.forEach(position => {
    result.groups[position] = {
      position,
      attrs: {
        circle: {
          r: 4,
          magnet: true,
          stroke: '#5F95FF',
          strokeWidth: 1,
          fill: '#fff',
          style: {
            visibility: 'hidden',
            zIndex: 1000
          },
        }
      }
    }
    result.items.push({ group: position })
  })
  return result
}